package com.boang.service;

import com.boang.ClaDao;
import com.boang.po.Cla;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
  @author: 13813
  @date: 2024/7/24 14:09
*/
@Service("claService")
public class ClaServiceImpl implements ClaService {

    @Autowired
    private ClaDao claDao;
    @Override
    public List<Cla> getClaList() {
        //打日志
//        System.out.println("业务开始了beforeLog");
//        try {
            //执行业务代码，调dao
            claDao.selectClaList();
            //打日志
//            System.out.println("业务结束了afterLog");
//        } catch (Exception e) {
//            System.out.println("出错了afterThrowingLog");
//        } finally {
//            System.out.println("最终afterReturningLog");
//        }
        return null;
    }

    @Override
    public int addCla(Cla cla) {
        //打日志
        System.out.println("业务开始了beforeLog");
        try {
            //执行业务代码，调dao
            claDao.selectClaList();
            //打日志
            System.out.println("业务结束了afterLog");
        } catch (Exception e) {
            System.out.println("出错了afterThrowingLog");
        } finally {
            System.out.println("最终afterReturningLog");
        }
        return 0;
    }


}
